﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class KhachHangBUS
    {
        public List<KhachHangDTO> LayKhachHang()
        {
            KhachHangDAO khDAO = new KhachHangDAO();  
            return khDAO.LayKhachHang();
        }
        public KhachHangDTO LayKhachTheoMa(string MaKH)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.LayKhachTheoMa(MaKH);
        }
        public bool ThemKhachHang(KhachHangDTO khDTO)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            if (khDAO.KTMaKH(khDTO.MaKH))
                return khDAO.ThemKhachHang(khDTO);
            return false;
        }

        public bool SuaThongTinKhachHang(KhachHangDTO khDTO)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.SuaThongTinKhachHang(khDTO);
        }
        public List<KhachHangDTO> LayKhachHangTheoTen(string TenKH)
        {
            KhachHangDAO khDAO = new KhachHangDAO();
            return khDAO.LayKhachHangTheoTen(TenKH);
        }
        public bool XoaKhachHang(string MaKH)
        {
            KhachHangDAO kh = new KhachHangDAO();
            return kh.XoaKhachHang(MaKH);
        }

    }
}
